package com.ithe.user.pojo.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * @BelongsProject: sso
 * @BelongsPackage: com.gxa.pojo.dto
 * @Author: jingjianghao
 * @CreateTime: 2022-08-11  16:43
 * @Description: TODO
 * @Version: 1.0
 */

@Api(value = "注册信息")
@Data
public class RegisterDto {
    @ApiModelProperty("用户名")
    @Pattern(regexp = "^[A-Za-z0-9]{5,20}$",message = "用户名不合法")
    private String username;

    @ApiModelProperty("密码")
    @Pattern(regexp = "^[A-Za-z0-9]{6,20}$",message = "密码不合法")
    private String password;

    @ApiModelProperty("确认密码 ")
    @Pattern(regexp = "^[A-Za-z0-9]{6,20}$",message = "确认密码不合法")
    private String password2;

    @ApiModelProperty("验证码 ")
    @NotEmpty(message = "验证码不能为空")
    private String code;

//    @ApiModelProperty("邮箱")
//    @Email(message = "邮箱格式不合法")
//    private String email;

    @ApiModelProperty("手机号码")
    @Pattern(regexp = "^((13[0-9])|(14[0,1,4-9])|(15[0-3,5-9])|(16[2,5,6,7])|(17[0-8])|(18[0-9])|(19[0-3,5-9]))\\d{8}$",message = "手机格式不合法")
    private String phone;
    @NotEmpty(message = "性别不能为空")
    @ApiModelProperty("性别")
    private Integer gender;
    @NotEmpty(message = "绰号不能为空")
    @Length(min=5,max=30,message = "长度在5到30")
    @ApiModelProperty("绰号")
    @TableField("nick_name")
    private String nickName;
    @NotEmpty(message = "生日不能为空")
    @ApiModelProperty("生日")
    private Date birthday;


}
